/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.sf.fc.io.ch;

import java.io.File;

/**
 *
 * Abstract class that provides callback methods to {@link org.apache.commons.io.FileCopier}
 * and extends {@link FileCopyHelper}.
 * <p>
 * It adds a method, <tt>createNewFile</tt>. This
 * method is called by the method <tt>handleExistingFile</tt> to create a file
 * object with a new name for the file. The <tt>createNewFile</tt> method can be
 * used by classes that decorate extensions to <tt>RenameFileCopyHelper</tt> like
 * {@link SafeRenameFileCopyHelper} to access the file after it has been given a
 * new name.
 *
 * @author David Armstrong
 */
public abstract class RenameFileCopyHelper extends FileCopyHelper {

    /**
     * Default constructor.
     */
    public RenameFileCopyHelper() {
        super();
    }

    /**
     * This method creates a new file with whatever rules the extension to
     * <tt>RenameFileCopyHelper</tt> defines.
     * @param dest
     * @return a File object with the new name. This method does not create the
     * file itself, only the File object. The <tt>handleExistingFile</tt> method
     * will create the file on disk.
     */
    public abstract File createNewFile(final File dest);
}
